home *** CD-ROM | disk | FTP | other *** search
/ Programming an RTS Game with Direct3D / Programming an RTS Game with Direct3D.iso / Examples / Chapter 15 / Example 15.2 / player.h < prev    next >
Encoding:
C/C++ Source or Header  |  2006-06-30  |  1.0 KB  |  41 lines

  1. #ifndef _RTS_PLAYER_
  2. #define _RTS_PLAYER_
  3.  
  4. #include <vector>
  5. #include "shader.h"
  6. #include "camera.h"
  7. #include "unit.h"
  8. #include "building.h"
  9. #include "terrain.h"
  10. #include "network.h"
  11.  
  12. void LoadPlayerResources(IDirect3DDevice9* m_pDevice);
  13. void UnloadPlayerResources();
  14.  
  15. class PLAYER
  16. {
  17.     friend class APPLICATION;
  18.     public:
  19.         PLAYER(int _teamNo, D3DXVECTOR4 _teamCol, INTPOINT startPos, TERRAIN* _terrain, IDirect3DDevice9* _Device);
  20.         ~PLAYER();
  21.  
  22.         void AddMapObject(int type, INTPOINT mp, bool isBuilding);
  23.         void RenderMapObjects(CAMERA &camera);
  24.         void PaintSelectedMapObjects(CAMERA &camera);
  25.         void UpdateMapObjects(float deltaTime);
  26.         INTPOINT FindClosestBuildingLocation(int buildType, INTPOINT mp);
  27.         void Select(MOUSE &mouse);
  28.         void UnitOrders(MOUSE &mouse);
  29.         INTPOINT GetCenter();
  30.  
  31.     private:
  32.         IDirect3DDevice9* m_pDevice;
  33.         std::vector<MAPOBJECT*> m_mapObjects;
  34.         D3DXVECTOR4 m_teamColor;
  35.         TERRAIN *m_pTerrain;
  36.         int m_teamNo;
  37.         bool m_areaSelect;
  38.         INTPOINT m_startSel;
  39. };
  40.  
  41. #endif